SELECT FORMMAIN_0698."ID",ORG_MEMBER.CODE usercode,FORMMAIN_0698.FIELD0008 glbdef1,
grade.ENUMVALUE glbdef2,grade.ENUMVALUE glbdef3, 
FORMMAIN_0698.FIELD0023 glbdef6,"TO_CHAR"(FORMMAIN_0698.FIELD0024,'yyyy-mm-dd hh24:mi:ss') glbdef7,"TO_CHAR"(FORMMAIN_0698.FIELD0009,'yyyy-mm-dd hh24:mi:ss') glbdef8,
CASE WHEN CTP_ENUM_ITEM.ENUMVALUE = 0 THEN 'Y' ELSE 'N' END glbdef11
FROM COL_SUMMARY
LEFT JOIN FORMMAIN_0698 ON FORMMAIN_0698."ID" = COL_SUMMARY.FORM_RECORDID
LEFT JOIN ORG_MEMBER ON ORG_MEMBER."ID" = FORMMAIN_0698.FIELD0001
LEFT JOIN ORG_POST ON ORG_POST."ID" = ORG_MEMBER.ORG_POST_ID
LEFT JOIN CTP_ENUM_ITEM ON CTP_ENUM_ITEM."ID" = FORMMAIN_0698.FIELD0022
LEFT JOIN CTP_ENUM_ITEM grade ON grade."ID" = FORMMAIN_0698.FIELD0025
WHERE COL_SUMMARY."ID" = '${id}'